<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例1 - 让浮动内容和周围的内容等高</title>
    <style>
        /* 计算BFC的高度时，浮动元素也参与计算; */
        .box {
            background-color: rgb(224, 206, 247);
            border: 5px solid rebeccapurple;
            overflow: hidden;
        }

        .float {
            float:left;
            width: 200px;
            height: 150px;
            background-color: white;
            border: 1px solid black;
            padding: 10px;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="float">I am a floated box!</div>
        <p>I am content inside the container.</p>
    </div>
</body>

</html>